import java.util.Arrays;

public class javademo {
    public static void main(String[] args) {
        double[] array2 ={1.0, 2.0, 3.0, 4.0, 5.0};
        for (double x:array2) {
            System.out.println(x);
        }
        //swap(a,b);
        //打印swap函数之后a与b的值
        /*add(2,3);
        add(1.5,1.5);
        System.out.println("a="+a+"  b="+b);*/
        /*System.out.println(fac(3));*/

        /*int arr[]=new int[10];
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }*/

    }
    public static int fac(int n){
        if(n==1){
            return n;
        }
        int ret=n*fac(n-1);
        return ret;
    }

    public static int add(int a,int b){
        return a+b;
    }
    public static double add(double a,double b){
        return a+b;
    }


    public static void swap(int a,int b){
        int index=0;
        index=a;
        a=b;
        b=index;
    }

    /**
     *
     * @param a整数
     * @param b整数
     * @return  ab之和
     */
    public static int add1(int a,int b){
        return a+b;
    }

    /**
     *
     * @param n:整数
     * @return n的阶乘
     */

    public static int fac4(int n){
        int ret=1;
        for (int i = 1; i <=n ; i++) {
            ret=ret*i;
        }
        return ret;
    }

    public static void main1(String[] args) {
        int y=fac(4);
        System.out.println(y);
    }
}
